<%@page import="db_interaction.Comentario"%>
<%@page import="java.util.Set"%>
<%@page import="db_interaction.Utilizador"%>
<%@page import="com.sun.org.apache.xml.internal.resolver.helpers.PublicId"%>
<%@page import="db_interaction.Publicacao"%>
<%@page import="db_interaction.Amigos"%>
<%@page import="Others.seachUsers"%>
<%
    if (session.isNew()) {
        response.sendRedirect("/TheHive/login/index.jsp");
    }
%>

<div class="mainbar">


    <%
        Boolean res_insert_commen = false;
        String email_user_login = (String) session.getAttribute("email");
        String comentario_desc = request.getParameter("AddComment");
        String id_publicacao_s = request.getParameter("id_publicacao");
        //int id_publicacao = Integer.getInteger(request.getParameter("id_publicacao")).intValue();
        int id_publicacao = Integer.parseInt(id_publicacao_s);
        Comentario com = new Comentario();

        res_insert_commen = com.InsertComment(email_user_login,comentario_desc,id_publicacao);
        

        if (res_insert_commen) {

            response.sendRedirect("/TheHive/login/MyProfile.jsp");

        } else {

            out.print("erro no pop");

        }
    %>

</div>